<template>
	<view>
		<image src="/static/yaoqingbg.png" class="images posiab width1000" mode="widthFix"></image>
		<view class="con posire">
			<back></back>
			<view  class="flex-ju-c pt350 flex-col">
				<view  @click="copy(info.my_invite)" class="wh527-111 ra20 size55 bold butg flex-ju-c bgfff posire">{{info.my_invite}}<view class="posiab size30 right50 mt10">复制</view></view>
				<view @click="$refs.haibao.open()" style="background: linear-gradient(90deg, #CAF881, #A0E99A);" class="wh527-111 ra20 flex-ju-c size30 bold mt40">
					<image src="/static/xiazais.png" class="image flex mr5 width27" mode="widthFix"></image>
					下载邀请海报
				</view>
				<view class="size26 mt50">已邀请{{info.invite_num}}人，有效邀请{{info.invite_idcard}}人，无效邀请{{info.invite_num - info.invite_idcard}}人</view>
				<view class="size24 color999 mt10 con center">有效邀请：完成实名、开通钱包、 完成首次消费下单（含一级或二级买入订单）</view>
			</view>
			<view class="con pb30 pl30 pr30 ra25 mt30 bgF6F6F6">
				<view v-if="!info.list.length" class="flex-ju-c pt8vh pb50">
					<view class="flex-ju-c flex-col">
						<image mode="widthFix" class="width210 ra20" src="/static/nodata.png"></image>
						<view class=" size24">这里什么也没有~</view>
					</view>
				</view> 
				<view v-for="(item,t) in info.list" :key="t" class="flex-ju-b pt30">
					<view class="flex-a-i">
							<image src="/static/aaa.png" class="wh83-83 flex ra83 mr15"></image>
						<view>
							<view class="size26">{{item.phone}}</view>
							<view class="color999 size24">{{item.created_at}}</view>
						</view>
					</view>
					<view v-if="item.vip_type==2" class="bold size26">{{item.idcard}}</view>
					<view v-else class="bold size26 color999">{{item.idcard}}</view>
				</view>
			</view>
		</view>
		<uni-popup type="center" ref="haibao">
			<view class="flex-ju-c flex-col">
				<image @click="pimg" :src="info.qr" class="width550" mode="widthFix"></image>
				<image @click="$refs.haibao.close()" src="/static/kaiheclose.png" class="width50 mt30" mode="widthFix"></image>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{
					list:[]
				}
			}
		},
		mounted() {
		},
		onLoad() {
			this.http('user/invite').then(res => {
				this.info = res.data
				// this.$refs.haibao.open()
			})
		},
		methods: {
			pimg(){
				uni.previewImage({
					urls: [this.info.qr], //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
					current: '', // 当前显示图片的http链接，默认是第一个
					success: function(res) {},
					fail: function(res) {},
					complete: function(res) {},
				})
			}
		}
	}
</script>

<style>
.butg{
	border: 3px solid #BBFF8C;
	box-shadow: 0rpx 9rpx 27rpx 1rpx rgba(0,0,0,0.14);
}
</style>
